#coding=utf-8
from django.db import models

# Create your models here.
'''
用户管理
'''
class users(models.Model):
    username=models.CharField(max_length=20,verbose_name='用户名',unique=True)
    password=models.CharField(max_length=50,verbose_name='密码')
    fullname=models.CharField(max_length=10,verbose_name='姓名')
    email=models.EmailField(max_length=75,verbose_name='电子邮箱',null=True)
    phone=models.CharField(max_length=20,verbose_name='固定电话',null=True)
    mobile=models.CharField(max_length=20,verbose_name='移动电话',null=True)
    permissions=models.CharField(max_length=1,choices=(('P', '业务员'),('A','管理员')),verbose_name='权限',null=True)
    valid=models.BooleanField(verbose_name='启用',default=True)
    def __unicode__(self):
        return u'%s(%s)'%(self.username,self.fullname)
    class Meta:
        verbose_name = "业务员"
        verbose_name_plural = "业务员"
        #ordering = ['-name']